/*
 * RoadSegmentMatcherByEdgeId.h
 *
 *  Created on: Oct 31, 2009
 *      Author: jbarreneche
 */

#ifndef ROADSEGMENTMATCHERBYEDGEID_H_
#define ROADSEGMENTMATCHERBYEDGEID_H_

#include "util/Matcher.h"
#include "core/StringToIdMatcher.h"
#include "map/RoadSegment.h"

class RoadSegmentMatcherByEdgeId: public Matcher<RoadSegment> {
public:
	RoadSegmentMatcherByEdgeId(string id) { this->id = id; }
	virtual ~RoadSegmentMatcherByEdgeId() {}
	virtual bool matches(RoadSegment* roadSegment) {
		StringToIdMatcher<Edge> matcher(id);
		return roadSegment->getDecreasingEdges().contains(&matcher)
			|| roadSegment->getIncreasingEdges().contains(&matcher);
	}
private:
	string id;
};

#endif /* ROADSEGMENTMATCHERBYEDGEID_H_ */
